<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<title>Login</title>
	<link rel="stylesheet" type="text/css" href="css/estilo_login.css" />
</h:head>
<h:body>
	<h:form id="formLogin">
		<div style="padding: 100px 0 0 250px;">
			<div id="login-box">
				<H2>Login</H2>
				Sistema de Alocação e Controle de Trabalhos de Conclusão de Curso. <br />
				<br />
				<div id="login-box-name" style="margin-top: 20px;">
					<p:outputLabel id="matriculaText">Matrícula:</p:outputLabel>
				</div>
				<div id="login-box-field" style="margin-top: 20px;">
					<p:inputText id="matricula" label="Matrícula"
						styleClass="form-login"
						value="#{LoginController.usuario.matricula}" required="true"></p:inputText>
				</div>
				<div id="login-box-name">
					<p:outputLabel id="senhaText">Senha:</p:outputLabel>
				</div>
				<div id="login-box-field">
					<p:password id="senha" label="Senha" styleClass="form-login"
						value="#{LoginController.usuario.senha}" required="true" />
				</div>
				<br /> <span class="login-box-options"> <a href="#"
					onclick="dialogRecuperarSenha.show()">Esqueci minha senha</a>
				</span> <br /> <br />
				<div id="dvBotoes">
					<p:commandButton value="Entrar" global="true"
						actionListener="#{LoginController.doEfetuarLogin}" />
					<p:commandButton value="Limpar" update="formLogin" process="@this">
						<p:resetInput target="formLogin"></p:resetInput>
					</p:commandButton>
				</div>
			</div>

		</div>
		<div id="DvMensagens">
			<p:messages id="messages" autoUpdate="true" closable="true" />
		</div>
	</h:form>

	<p:dialog widgetVar="dialogRecuperarSenha" modal="true"
		appendToBody="true" header="Recuperar Senha">
		<h:form id="formTable">
			<h:panelGrid columns="2" cellpadding="10">
				<p:outputLabel>Matrícula: </p:outputLabel>
				<p:inputMask label="Matrícula" maxlength="9" required="true"
					value="#{LoginController.usuarioRecuperarSenha.matricula}" />
				<p:outputLabel>E-mail: </p:outputLabel>
				<p:inputText label="E-mail" required="true"
					value="#{LoginController.usuarioRecuperarSenha.email}"></p:inputText>
			</h:panelGrid>
			<p:commandButton value="Recuperar"
				action="#{LoginController.doRecuperarSenha}"
				oncomplete="handleDialogo()" />
			<p:button value="Cancelar" onclick="handleDialogo()" />
		</h:form>
	</p:dialog>

	<script type="text/javascript">
			function handleDialogo() {
				dialogRecuperarSenha.hide();
			}
		</script>
</h:body>

</html>

